Release 10.1A: OpenEdge Data Management:
SQL Reference


UPDATE

Updates the rows and columns of the specified table with the given values for rows that satisfy the search_condition.

Syntax

UPDATE table_name 
  SET assignment [, assignment ] , ... 
  [ WHERE search_condition ] ; 

assignment:

This is the syntax for assignment:

Syntax
column = { expr | NULL } 
  | ( column [, column ] , ... ) = ( expr [, expr ] ) 
  | ( column [, column ] , ... ) = ( query_expression ) 

Notes

Examples

UPDATE Orderline 
     SET Qty = 186 
     Where Ordernum = 22; 
  
  
Update Orderline 
      SET (Itemnum) =  
                      (Select Itemnum  
                       FROM Item 
                       WHERE Itemname = 'Tennis balls') 
     WHERE Ordernum = 20; 
UPDATE Orderline 
          SET (Qty) = (200 * 30) 
          WHERE OrderNum = 19; 
  
  
UPDATE OrderLine 
          SET (ItemNum, Price) =  
                              (SELECT ItemNum, Price * 3 
                               FROM Item 
                               WHERE ItemName = 'gloves')  
          WHERE OrderNum = 21 ; 

Authorization

Must have DBA privilege or UPDATE privileges on all the specified columns of the target table, and SELECT privilege on all the other tables referred to in the statement.

Related statements

SELECT, OPEN, FETCH


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095